package com.diandian.backend.store.controller;

import com.diandian.backend.store.dto.MeituanShangouStoreDetailOpenApiParamDTO;
import com.diandian.backend.store.service.MeituanShangouStoreService;
import com.diandian.base.boot.starter.response.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * [门店]美团闪购门店API
 * 说明：
 *      belong + orgId + orgCode 共同定位一个租户
 *      一个租户下，门店编码唯一
 *
 * @author zyz diandian@qq.com
 * @since 1.0.0 2025-08-25
 */
@RestController
@RequestMapping("/meituan/shangou/store/open/api")
public class MeituanShangouStoreOpenApiController {

    @Autowired
    private MeituanShangouStoreService meituanShangouStoreService;


    /**
     * 根据门店编码查询门店信息
     * 必须参数：belong、id和code二选一
     * 可选参数：orgId、orgCode
     */
    @PostMapping("/detail")
    public BaseResult getDetail(@RequestBody MeituanShangouStoreDetailOpenApiParamDTO param) {
        param.check();
        return new BaseResult(0, "success", meituanShangouStoreService.getStoreDetail(param));
    }
}